home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / a-taside.adb < prev    next >
Text File  |  1994-05-19  |  3KB  |  90 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --              A D A . T A S K _ I D E N T I F I C A T I O N               --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.4 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. with System.Tasking.Abortion;
  26. with System.Tasking.Stages;
  27. with System.Tasking.Rendezvous;
  28.  
  29. package body Ada.Task_Identification is
  30.  
  31.    subtype Tid is System.Tasking.Task_ID;
  32.  
  33.    ---------
  34.    -- "=" --
  35.    ---------
  36.  
  37.    function  "=" (Left, Right : Task_Id) return Boolean is
  38.    begin
  39.       return System.Tasking."=" (Tid (Left), Tid (Right));
  40.    end "=";
  41.  
  42.    -----------------
  43.    -- Abort_Task --
  44.    ----------------
  45.  
  46.    procedure Abort_Task (T : in out Task_Id) is
  47.    begin
  48.       System.Tasking.Abortion.Abort_Tasks
  49.         (System.Tasking.Task_List'(1 => Tid (T)));
  50.    end Abort_Task;
  51.  
  52.    ------------------
  53.    -- Current_Task --
  54.    ------------------
  55.  
  56.    function Current_Task return Task_Id is
  57.    begin
  58.       return Task_Id (System.Tasking.Self);
  59.    end Current_Task;
  60.  
  61.    -----------
  62.    -- Image --
  63.    -----------
  64.  
  65.    function Image (T : Task_Id) return String is
  66.    begin
  67.       return "???";  --  ???
  68.    end Image;
  69.  
  70.    -----------------
  71.    -- Is_Callable --
  72.    -----------------
  73.  
  74.    function Is_Callable (T : Task_Id) return Boolean is
  75.    begin
  76.       return System.Tasking.Rendezvous.Callable (Tid (T));
  77.    end Is_Callable;
  78.  
  79.    -------------------
  80.    -- Is_Terminated --
  81.    -------------------
  82.  
  83.    function Is_Terminated (T : Task_Id) return Boolean is
  84.    begin
  85.       return
  86.         System.Tasking.Stages.Terminated (Tid (T));
  87.    end Is_Terminated;
  88.  
  89. end Ada.Task_Identification;
  90.